import auth from '@/components/auth-redirect.vue'
import Layout from '@/layout'
import { homedir } from 'os';

const constantRoutes = [
  {path:'/login',name:'login',hidden:true, component:()=>import('@/components/login/login.vue')},
  {
    path: '/',
    component: Layout, 
    redirect: '/dashboard', 
    name:'home',
    children:[{path:'dashboard',basepath:'/dashboard',name:'Dashboard', component:()=>import('@/components/dashboard/dashboard'),
    meta: { title: 'Dashboard', icon: 'dashboard', affix: true }},
    {path:'documentation',basepath:'/documentation',name:'Documentation', component:()=>import('@/components/documentation'),
    meta: { title: 'Documentation', icon: 'documentation', affix: true }}
  ]
  },
  {
    path:'/charts',
    component:Layout,
    meta: {
      title: 'Charts',
      icon: 'lock',
      roles: ['admin', 'editor'] // you can set roles in root nav
    },
    children:[
      {path:'line',basepath:'/charts/line',name:'Line',component:()=>import('@/components/charts/line'),meta: { title: 'Line'}},
      {path:'mix',basepath:'/charts/mix',name:'Mix',component:()=>import('@/components/charts/mix'),meta: { title: 'Mix'}},
      {path:'keybord',basepath:'/charts/keybord',name:'Keybord',component:()=>import('@/components/charts/keybord'),meta: { title: 'Keybord'}}
    ]
  },
  {
    path:'/example',
    component:Layout,
    meta: {
      title: 'example',
      icon: 'lock',
      roles: ['admin', 'editor'] // you can set roles in root nav
    },
    children:[
      {path:'create',basepath:'/example/create',name:'create',component:()=>import('@/components/example/create'),meta: { title: 'create'}},
      {path:'list',basepath:'/example/list',name:'list',component:()=>import('@/components/example/list'),meta: { title: 'List'}},
      {path:'edit/:id',hidden:true, basepath:'/example/edit/:id',name:'edit',component:()=>import('@/components/example/edit'),props:true}
    ]
  },
  {path:'/auth-redirect',exctra:true,component:auth,meta: { title: 'auth-redirect', icon: 'dashboard', affix: true }}
]
export default constantRoutes